﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="NoticeEdit.ascx.cs" Inherits="CentralOffice.WebClient.PublicAffairs.NoticeEdit" %>

<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>

<table class="TableBlock" width="95%" align="center" id="tblEnterpriseEditView" runat="server">
 <tr>
       <td nowrap class="TableData">通知名称：</td><td nowrap class="TableData" width=50%><asp:TextBox ID="txtName" CssClass="BigInput" runat="server" Width="80%"></asp:TextBox><span class="warning">*</span><asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="必须通知标题" ControlToValidate="txtName">请先填写标题</asp:RequiredFieldValidator></td>
       <td nowrap class="TableData">重要程度：</td><td nowrap class="TableData"><asp:DropDownList ID="ddlSignificant" runat="server"></asp:DropDownList></td>
   </tr>
<%--   
   <tr>
       <td nowrap class="TableData">重要性：</td><td nowrap class="TableData"><asp:TextBox ID="txtKeywords" runat="server" CssClass="BigInput" ></asp:TextBox></td>
       <td nowrap class="TableData" >最迟回复时间：</td><td nowrap class="TableData"><asp:TextBox ID="txtLastReplyDate" runat="server" CssClass="BigInput" ></asp:TextBox>&nbsp;<img onclick="WdatePicker({el:$dp.$(NoticeEdit1_txtLastReplyDate), dateFmt:'yyyy-MM-dd HH:mm:ss'})" src="../inc/js/My97DatePicker/skin/datePicker.gif" width="16" height="22" align="absmiddle">
       <%--<asp:RegularExpressionValidator ID="RegularExpressionValidator6" runat="server" ErrorMessage="人数必须为整数" ControlToValidate="txtEmpCount" ValidationExpression="^\d*$">*</asp:RegularExpressionValidator></td>
   </tr>
  --%> 
   <tr>
       <td nowrap class="TableData" style="width: 88px">简述：</td><td nowrap class="TableData" colspan="3"><asp:TextBox ID="txtProfile" runat="server" CssClass="BigInput" Width="96%"></asp:TextBox></td>
   </tr>
   <tr>
       <td class="TableData">接收者：</td><td class="TableData" colspan="3">
    <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional" RenderMode="Inline"><ContentTemplate>
    <input type="text" id="txtAccepterReadOnly" style="width:70%" name="txtAccepterReadOnly" class="SmallStatic" runat="server" readonly="readonly" /><asp:HiddenField ID="txtAccepter" runat="server" />&nbsp;<asp:LinkButton ID="btnShowPopup" runat="server" OnClick="btnShowPopup_Click" CssClass="orgAdd">添加</asp:LinkButton>
    </ContentTemplate><Triggers><asp:AsyncPostBackTrigger ControlID="btnOK" /></Triggers></asp:UpdatePanel>&nbsp;<a href="javascript:;" class="orgClear" onclick="$get('<%= txtAccepterReadOnly.ClientID %>').value='';$get('<%= txtAccepter.ClientID %>').value='';">清空</a><asp:CheckBox ID="chkAll" Text="所有人" Checked="true" runat="server" />
    </td>
   </tr>
   <tr>
       <td nowrap class="TableData" style="width: 88px">附件：</td><td nowrap  colspan="3" class="TableData">
           <asp:FileUpload ID="FileUpload1" runat="server" />
       </td>
   </tr>
   <tr>
       <td nowrap class="TableData" style="width:88px;">内容：</td><td nowrap  colspan="3" class="TableData"><FCKeditorV2:FCKeditor ID="txtContentText" Height="400px" runat="server" ToolbarSet="Basic2"></FCKeditorV2:FCKeditor></td>
   </tr>

   <tr>
   <td nowrap class="TableControl" colspan="4" align="center" style="margin-left:20px; float:left;">
       <asp:Button ID="btnSave" runat="server" Text="保存" CssClass="BigButton" OnClick="btnSave_Click"  /> <%--OnClientClick="if(ddlCategory.selectedIndex == 0) { alert(' 您必须选择一个企业类别！'); return false;} "--%>
       
       <input type="button" id="btnCancel" name="btnCancel" value="取消" class="BigButton" style="margin-left:40px;" onclick="history.back();" />
       </td>
   </tr>
</table>
<script type="text/javascript">
//<![CDATA[

    var enterpriseBox = $get("<%= txtAccepterReadOnly.ClientID %>"); //document.getElementById

//]]>
</script>



<asp:Panel ID="pnlPopup" runat="server" CssClass="x-pne" style="display:none; width:460px;">
    <asp:UpdatePanel ID="updPnlDepartment" runat="server" UpdateMode="Conditional">
    <ContentTemplate>

    <asp:Button id="btnShowEdit" runat="server" style="display:none" />
    <ajaxToolKit:ModalPopupExtender ID="mdlDetailView" runat="server" 
        BehaviorID="detailView" 
        TargetControlID="btnShowEdit" 
        PopupControlID="pnlPopup" 
        CancelControlID="btnClose" BackgroundCssClass="modalBackground" 
        PopupDragHandleControlID="pnlDrag" />
        
    <asp:Panel ID="pnlDrag" runat="server" CssClass="corner-bg x-pne-lt x-pne-left">
        <div class="corner-bg x-pne-rt x-pne-right">
            <div class="corner-bg x-pne-t dragTitle">
                <div class="x-pne-btn" id="Div1" onclick="$find('detailView').hide();"></div>
                <div class="x-pne-caption font dragTitle"><span>请选择接收者</span></div>
            </div>
        </div>
    </asp:Panel>

    <div>
    
        <div class="side-bg x-pne-l">
            <div class="side-bg x-pne-r">
                <div class="x-pne-c" style="WIDTH: 448px;">
					<div style="margin:10px;font-size:9pt;" class="wrapper">
					
<div id="div2" style="width:430px;height:300px; overflow:auto;">
<asp:TreeView ID="tvEmp" runat="server" EnableViewState="true" OnLoad="tvEmp_Load"></asp:TreeView>
</div>
                    
                    <!-- 下面是确认按钮 -->
                    <div style="width:328px; margin-top:16px;">
                        <table  style="width:100%; margin-left:40px;">
                            <tr>
                                <td>
<div class="btn-side btn-bg"></div>
<div class="btn-body btn-bg" style="background-position: 0px 168px; width: 66px"><asp:Button ID="btnOK" runat="server" Text="  确定  " CssClass="font" OnClick="btnOK_Click" /></div>
<div class="btn-side btn-bg" style="background-position: 0px 189px"></div>

                                </td>
                                <td>
<div class="btn-side btn-bg"></div>
<div class="btn-body btn-bg" style="background-position: 0px 168px; width: 66px;"><asp:Button ID="btnClose" runat="server" Text="  取消  " CssClass="font" /></div>
<div class="btn-side btn-bg" style="background-position: 0px 189px"></div>
                                </td>
                            </tr>
                        </table>
                    </div>
                        
					</div>
                </div>
            </div>
        </div>

        <div class="corner-bg x-pne-lb x-pne-left">
            <div class="corner-bg x-pne-rb x-pne-right">
                <div class="corner-bg x-pne-b"></div>
            </div>
        </div>
        
    </div>
    
    </ContentTemplate>
    </asp:UpdatePanel>
</asp:Panel>

<asp:updateprogress id="updateProgress"  runat="server">
    <progresstemplate>
        <div id="progressBackgroundFilter"></div>
        <div id="processMessage">正在处理数据，请稍等...<br /><br /><img alt="Loading" src="../images/loading_16.gif" /></div>
    </progresstemplate>
</asp:updateprogress>



<script type="text/javascript">
    function selectAll() {
        var tree = document.getElementById("<%=tvEmp.ClientID%>");
        if (typeof (tree) === "undefined" && tree === null) return;

        var checkBoxs = tree.getElementsByTagName('INPUT');
        for (var i = 0; i < checkBoxs.length; i++) {
            if (checkBoxs[i].type == "checkbox") {
                checkBoxs[i].checked = true;
            }
        }
    }

    function reverse() {
        var tree = document.getElementById("<%=tvEmp.ClientID%>");
        if (typeof (tree) === "undefined" && tree === null) return;

        var checkBoxs = tree.getElementsByTagName('INPUT');
        for (var i = 0; i < checkBoxs.length; i++) {
            if (checkBoxs[i].type == "checkbox") {
                checkBoxs[i].checked = !checkBoxs[i].checked;
            }
        }
    }

    function OnTreeNodeChecked() {
        var ele = window.event.srcElement;
        if (ele.type == 'checkbox') {
            var childrenDivID = ele.id.replace('CheckBox', 'Nodes');
            var div = document.getElementById(childrenDivID);
            if (div == null) return;
            var checkBoxs = div.getElementsByTagName('INPUT');
            for (var i = 0; i < checkBoxs.length; i++) {
                if (checkBoxs[i].type == 'checkbox')
                    checkBoxs[i].checked = ele.checked;
            }
        }
    }

    function checkAccepter() {
        var chkBox = $get('<%= chkAll.ClientID %>');
        if (!chkBox.checked) {
            if ($get('<%= txtAccepter.ClientID %>').value == '') {
                alert("如果您没有选择所有人都可以参与本帖，则必须明确指明本帖的参与者！");
                return false;
            }
        }
        return true;
    }
</script>